<template>
  <div class="model-wrap">
    <button class="btn btn-primary btn-sm" @click=" showModal = true ">录入规则</button>
    <modal
      title="录入规则"
      ok-text="提交"
      cancel-text="取消"
      effect="fade"
      :small="true"
      :width="460"
      :show.sync="showModal"
      :callback="submit">
      <div slot="modal-body" class="modal-body">
        <form class="form-horizontal" role="form" v-el:form>
          <div class="form-group form-group-sm">
            <label class="col-sm-3 control-label">*券商</label>
            <div class="col-sm-9 text-left">
                <v-select :disabled=false :value.sync="rule.securityCode" 
                  :options="securitySelect.options" options-value="val" 
                  multiple name="securityCode[]"
                  justified  close-on-select>
                </v-select>
            </div>
          </div>
          <div class="form-group form-group-sm">
            <label class="col-sm-3 control-label">*操作行为</label>
            <div class="col-sm-9 text-left">
                <v-select :disabled=false :value.sync="rule.operate" 
                  :options="operateSelect.options" options-value="val" 
                  multiple name="operate[]"
                  justified close-on-select>
                </v-select>
            </div>
          </div>
          <div v-show="existOpen !== -1" class="form-group form-group-sm">
            <label class="col-sm-3 control-label">*开户奖励</label>
            <div class="col-sm-9 text-left">
              <input type="number" class="form-control" v-model="rule.openPrice">
            </div>
          </div>
          <div v-show="existDeal !== -1" class="form-group form-group-sm">
            <label class="col-sm-3 control-label">*交易奖励</label>
            <div class="col-sm-9 text-left">
              <input type="number" class="form-control" v-model="rule.dealPrice">
            </div>
          </div>
          <div class="form-group form-group-sm">
            <label class="col-sm-3 control-label">用户范围</label>
            <div class="col-sm-9 text-left">
              <input type="text" class="form-control" v-model="rule.userRange">
            </div>
          </div>
        </form>
      </div>
    </modal>
  </div>
</template>
<script src="./rule-add.js"></script>